<!-- 会员中心主内容区 -->
<div class="page-article">
<div class="member_welhead"><ins></ins><b><{t}>Мои сообщения<{/t}></b> </div>
  <!-- 站内信：发送管理员 -->
  <div id="member_messagebox" class="member-messagebox">
    <div class="member-tabs">
      <a href="<{link app=b2c ctl=site_member act=send}>"><em><{t}>发消息<{/t}></em></a>
      <a href="<{link app=b2c ctl=site_member act=inbox}>"><em><{t}>收件箱<{/t}><{if $inbox_num!=0}>(<{$inbox_num}>)<{/if}></em></a>
      <a href="<{link app=b2c ctl=site_member act=track}>"><em><{t}>发件箱<{/t}></em></a>
      <a href="<{link app=b2c ctl=site_member act=outbox}>"><em><{t}>草稿箱<{/t}><{if $outbox_num!=0}>(<{$outbox_num}>)<{/if}></em></a>
      <a href="<{link app=b2c ctl=site_member act=message}>" class="active"><em><{t}>给管理员发消息<{/t}></em></a>
    </div>
    <div class="member-mod member-messagebox-list">
      <div class="post-message">
        <form action="<{link app=b2c ctl=site_member full=1 act=send_msg}>" method="post">
            
			<div class="form-group">
			<label for=""><{t}>收件人<{/t}>：</label>
			<input type="text" name="admin" id="" class="x-input form-control" value="<{t}>管理员<{/t}>" disabled>
			</div>
		   
			<div class="form-group">
            <label for=""><{t}>标题<{/t}><{t}>：<{/t}></label>
            <input type="text" name="subject" id="" class="x-input form-control" vtype="required">
			</div>

			<div class="form-group">
			<label for=""><{t}>内容<{/t}><{t}>：<{/t}></label>
            <textarea name="comment" id="" class="x-input form-control" cols="50" rows="5" vtype="required"></textarea>
			</div>
			
			<div class="form-group">
			<button type="submit" class="btn btn-primary pull-right action-sendmsg" rel="_request"><span><span><{t}>发送<{/t}></span></span></button>
            <button type="submit" class="btn btn-default pull-right action-savetodrafts" name="has_sent" value="false" rel="_request"><span><span><{t}>保存到草稿箱<{/t}></span></span></button>
			<div class="clearfix"></div>
			</div>
			
        </form>
      </div>
    </div>
  </div>
</div>

<script>
$('member_messagebox').addEvents({
    'click:relay(.action-sendmsg)': function (e) {
        var hidden = $('action_submit_save');
        if(hidden) hidden.value = '';
    },
    'click:relay(.action-savetodrafts)': function (e) {
        $('action_submit_save') || new Element('input#action_submit_save[type=hidden]', {name: this.name, value: getValue(this)}).inject(this, 'after');
    }
});
function getValue(el) {
    /* <ltIE9> */
    var pollutesGetAttribute = (function(div){
      div.random = 'attribute';
      return (div.getAttribute('random') == 'attribute');
    })(document.createElement('div'));
    /* </ltIE9> */
    return pollutesGetAttribute ? el.getAttributeNode('value').nodeValue : el.get('value');
}
</script>
